{% extends "wms/base.html" %}
{% block content %}
    <div class="layui-container">
        <blockquote class="layui-elem-quote">
            {% if update %}
            <h1>修改部门</h1>
            {% elif create %}
            <h1>添加部门</h1>
            {% endif %}
        </blockquote>

        <div class="layui-row">
            <div class="layui-col-md5">
              {% if update %}
              <form action="/wms/department-update?wms_dcode={{to_update.dcode}}" method="post" enctype="multipart/form-data"/>
              {% elif create %}
              <form action="/wms/department-create" method="post" enctype="multipart/form-data"/>
              {% else %}
              <form action="/wms/department" method = "GET">
              {% endif %}

                  {% csrf_token %}

                  <input type="text" name="wms_dname" placeholder="部门名称" class="layui-input" value="{{to_update.dname}}" />
                  <hr class="layui-bg-green">

                  <input type="number" name="wms_minimum_wage" placeholder="最低薪资" class="layui-input" value="{{to_update.minimum_wage}}" />
                  <hr class="layui-bg-green">

                  {% if update %}
                  <input type="submit" value="修改" class="layui-btn"/>
                  {% elif create %}
                  <input type="submit" value="添加" class="layui-btn"/>
                  {% endif %}
              </form>
            </div>
        </div>
    </div>
{% endblock %}